//
//  BCMessageDetailViewController.m
//  BangcaiBuy
//
//  Created by Liang Zhang on 16/7/8.
//  Copyright © 2016年 BCB. All rights reserved.
//

#import "BCMessageDetailViewController.h"

@interface BCMessageDetailViewController ()

@end

@implementation BCMessageDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self p_initNavgationBar];
    [self p_initDetailWebView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    //隐藏导航栏
    self.navigationController.navigationBar.hidden = NO;
    
    if (!self.rdv_tabBarController.tabBarHidden) {
        [[self rdv_tabBarController] setTabBarHidden:YES animated:YES];
    }
}

-(void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    if (self.rdv_tabBarController.tabBarHidden) {
        [[self rdv_tabBarController] setTabBarHidden:NO animated:YES];
    }
}

#pragma mark - View init
-(void)p_initNavgationBar {
    self.title = @"消息";
    self.view.backgroundColor = [UIColor whiteColor];
}

-(void)p_initDetailWebView {
    UIWebView *msgDetailWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-self.navigationController.navigationBar.frame.size.height-20.f)];
    [self.view addSubview:msgDetailWebView];
    NSString *path = [[NSBundle mainBundle] pathForResource:@"MessageWebContent/message" ofType:@"html"];
    NSURL *msgDetailURL = [NSURL fileURLWithPath:path];
    NSURLRequest *msgDetailUrlRequest = [NSURLRequest requestWithURL:msgDetailURL];
    [msgDetailWebView loadRequest:msgDetailUrlRequest];
}

@end
